package com.hfi.mymap;


import java.lang.reflect.Method;

/**
 * @author ChangLiang
 * @date 2019/5/20
 */
public class MyMapperMethod {

    private final MethodSignature methodSignature;

    public MyMapperMethod(Method method) {

        this.methodSignature = new MethodSignature(method);
    }

    public static class MethodSignature {
        private final MyParamNameResolver myParamNameResolver;

        public MethodSignature(Method method) {
            this.myParamNameResolver = new MyParamNameResolver(method);
        }

        public Object convertArgsToParam(Object[] args) {
            return myParamNameResolver.getNameParams(args);
        }
    }

    public Object getParamsMap(Object[] args) {
        return methodSignature.convertArgsToParam(args);
    }
}